#run me: 
#sh -x  ./runme.sh insert  2>&1 | tee  run.log

rm -fr *.out *.bc klee* *elf*

target=$1

echo "$target.c-->$target.bc"
clang -I /root/klee/include -emit-llvm -c -g -O0 -Xclang -disable-O0-optnone $target.c

echo "$target.bc-->klee-last(test case)"
# klee --external-calls=all   --libc=uclibc --posix-runtime --smtlib-human-readable   $target.bc
klee --external-calls=all   --libc=uclibc --posix-runtime --solver-backend=z3  $target.bc

echo "$target.c-->$target.elf_eat_test_case"
gcc -I /root/klee/include   $target.c -lkleeRuntest -o $target.elf_eat_test_case
ls -1 klee-last/*.ktest | awk '{printf("  KTEST_FILE=%s ./$target.elf_eat_test_case\n",  $0)}' | sh -x

grep -i assert -B 1 $target.log